package item;

import hibernateUtil.Playerinfo;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.hibernate.HibernateException;

public class StoreHousesUserType extends BagsUserType {
	public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
			throws HibernateException, SQLException {
		byte[] bytes = resultSet.getBytes(names[0]);
		if (bytes == null) {
			return ((Playerinfo) owner).initStoreHouser();
		} else {
			return ItemUtil.getStoreHousesFromDB(bytes, (Playerinfo) owner);
		}
	}

}
